{{include file="public/header" /}}

<!-- right content start  -->
<div class="content-right">
	<div class="content">
		<!-- form start -->
		<form class="am-form form-validation form-search" method="post" action="{{:MyUrl('admin/user/index')}}" request-type="form">
			<div class="thin">
                <div class="am-input-group am-input-group-sm am-fl so">
                    <input type="text" autocomplete="off" name="keywords" class="am-radius" placeholder="姓名/手机/邮箱/昵称" value="{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}" />
                    <span class="am-input-group-btn">
                        <button class="am-btn am-btn-default am-radius" type="submit" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
                    </span>
                </div>
                <label class="am-fl thin_sub more-submit">
                    更多筛选条件
                    {{if isset($params['is_more']) and $params['is_more'] eq 1}}
                        <input type="checkbox" name="is_more" value="1" id="is_more" checked />
                        <i class="am-icon-angle-up"></i>
                    {{else /}}
                        <input type="checkbox" name="is_more" value="1" id="is_more" />
                        <i class="am-icon-angle-down"></i>
                    {{/if}}
                </label>
            </div>
            <table class="so-list more-where {{if !isset($params['is_more'])}}none{{/if}}">
                <tbody>
                	<tr>
                		<td>
                			<span>性别：</span>
							<select name="gender" class="chosen-select" data-placeholder="性别...">
								<option value="-1">性别...</option>
								{{foreach $common_gender_list as $v}}
									<option value="{{$v.id}}" {{if isset($params['gender']) and $params['gender'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
								{{/foreach}}
							</select>
                		</td>
                		<td>
                			<span>状态：</span>
							<select name="status" class="chosen-select" data-placeholder="状态...">
								<option value="-1">状态...</option>
								{{foreach $common_user_status_list as $v}}
									<option value="{{$v.id}}" {{if isset($params['status']) and $params['status'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
								{{/foreach}}
							</select>
                		</td>
                	</tr>
                	<tr>
                        <td class="time">
							<span>时间：</span>
                            <span>
                                <input type="text" autocomplete="off" name="time_start" class="am-form-field am-input-sm am-radius Wdate" placeholder="起始时间" value="{{if !empty($params.time_start)}}{{$params.time_start}}{{/if}}" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
                            </span>
                            <em class="text-grey">~</em>
                            <span>
                                <input type="text" autocomplete="off" name="time_end" class="am-form-field am-input-sm am-radius Wdate" placeholder="结束时间" value="{{if !empty($params.time_end)}}{{$params.time_end}}{{/if}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
                            </span>
                        </td>
                        <td>
                            <button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
                            <a href="{{:MyUrl('admin/user/index')}}" class="am-btn am-btn-warning am-radius am-btn-sm reset-submit">清除条件</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </form>
        <!-- form end -->

        <!-- operation start -->
        <div class="am-g m-t-15">
            <a href="{{:MyUrl('admin/user/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
            {{if !IsMobile()}}
            	<a href="{{$excel_url}}" class="am-btn am-btn-success am-btn-xs m-l-10 am-icon-file-excel-o am-radius"> 导出Excel</a>
            {{/if}}
        </div>
        <!-- operation end -->

		<!-- list start -->
		<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10 m-l-5">
			<thead>
				<tr>
					<th>编号</th>
					<th>基础信息</th>
					<th class="am-hide-sm-only">积分</th>
					<th class="am-hide-sm-only">性别</th>
					<th class="am-hide-sm-only">状态</th>
					<th class="am-hide-sm-only">生日</th>
					<th>更多</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				{{if !empty($data_list)}}
					{{foreach $data_list as $v}}
						<tr id="data-list-{{$v.id}}">
							<td>{{$v.id}}</td>
							<td class="user-info">
								<img src="{{$v.avatar}}" class="am-fl am-img-thumbnail am-radius am-hide-sm-only" />
                                <ul class="user-base am-fl">
                                    <li>名称：{{if empty($v['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.username}}{{/if}}</li>
                                    <li>昵称：{{if empty($v['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.nickname}}{{/if}}</li>
                                    <li>手机：{{if empty($v['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.mobile}}{{/if}}</li>
                                    <li>邮箱：{{if empty($v['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.email}}{{/if}}</li>
                                </ul>
							</td>
							<td class="am-hide-sm-only">
								{{if empty($v['integral'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.integral}}{{/if}}
							</td>
							<td class="am-hide-sm-only">
								{{if empty($v['gender_text'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.gender_text}}{{/if}}
							</td>
							<td class="am-hide-sm-only">
								{{if empty($v['status_text'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.status_text}}{{/if}}
							</td>
							<td class="am-hide-sm-only">
								{{if empty($v['birthday_text'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.birthday_text}}{{/if}}
							</td>
							<td>
								<span class="am-icon-caret-down c-p" data-am-modal="{target: '#my-popup{{$v.id}}'}"> 查看更多</span>
								<div class="am-popup am-radius" id="my-popup{{$v.id}}">
									<div class="am-popup-inner">
										<div class="am-popup-hd">
											<h4 class="am-popup-title">详情内容</h4>
											<span data-am-modal-close class="am-close">&times;</span>
										</div>
										<div class="am-popup-bd">
											<dl class="dl-content">
												<dt>用户名</dt>
												<dd>{{if empty($v['username'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.username}}{{/if}}</dd>

												<dt>昵称</dt>
												<dd>{{if empty($v['nickname'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.nickname}}{{/if}}</dd>

												<dt>手机号码</dt>
												<dd>{{if empty($v['mobile'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.mobile}}{{/if}}</dd>

												<dt>电子邮箱</dt>
												<dd>{{if empty($v['email'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.email}}{{/if}}</dd>

												<dt>状态</dt>
												<dd>{{if empty($v['status_text'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.status_text}}{{/if}}</dd>

												<dt>支付宝openid</dt>
												<dd>{{if empty($v['alipay_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.alipay_openid}}{{/if}}</dd>

												<dt>微信openid</dt>
												<dd>{{if empty($v['weixin_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.weixin_openid}}{{/if}}</dd>

												<dt>百度openid</dt>
												<dd>{{if empty($v['baidu_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.baidu_openid}}{{/if}}</dd>

												<dt>性别</dt>
												<dd>{{if empty($v['gender_text'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.gender_text}}{{/if}}</dd>

												<dt>生日</dt>
												<dd>{{if empty($v['birthday_text'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.birthday_text}}{{/if}}</dd>

												<dt>所在省</dt>
												<dd>{{if empty($v['province'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.province}}{{/if}}</dd>

												<dt>所在市</dt>
												<dd>{{if empty($v['city'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.city}}{{/if}}</dd>

												<dt>详细地址</dt>
												<dd>{{if empty($v['address'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.address}}{{/if}}</dd>

												<dt>积分</dt>
												<dd>{{if empty($v['integral'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.integral}}{{/if}}</dd>

												<dt>用户头像</dt>
												<dd>
													{{if !empty($v['avatar'])}}
														<img src="{{$v['avatar']}}" class="am-img-thumbnail am-radius" width="100" height="100" />
													{{else /}}
														<span class="cr-ddd">暂无图片</span>
													{{/if}}
												</dd>

												<dt>注册时间</dt>
												<dd>{{$v.add_time}}</dd>

												<dt>更新时间</dt>
												<dd>{{$v.upd_time}}</dd>
											</dl>
										</div>
									</div>
								</div>
							</td>
							<td class="view-operation">
								<a href="{{:MyUrl('admin/user/saveinfo', array_merge($params,array('id'=>$v['id'])))}}">
									<button class="am-btn am-btn-secondary am-btn-xs am-radius am-icon-edit"> 编辑</button>
								</a>
								<button class="am-btn am-btn-danger am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:MyUrl('admin/user/delete')}}" data-id="{{$v.id}}"> 删除</button>

                                <!-- 用户列表操作钩子 -->
                                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
                                    <div class="plugins-tag">
                                        <span>plugins_view_admin_user_list_operation</span>
                                    </div>
                                {{/if}}
                                {{php}}
                                    $hook_name = 'plugins_view_admin_user_list_operation';
                                    $hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true, 'id'=>$v['id'], 'data'=>$v]);
                                    if(!empty($hook_data) && is_array($hook_data))
                                    {
                                        foreach($hook_data as $hook)
                                        {
                                            if(is_string($hook) || is_int($hook))
                                            {
                                                echo htmlspecialchars_decode($hook);
                                            }
                                        }
                                    }
                                {{/php}}
							</td>
						</tr>
					{{/foreach}}
				{{/if}}
			</tbody>
		</table>
        {{if empty($data_list)}}
            <div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
        {{/if}}
		<!-- list end -->

		<!-- page start -->
		{{if !empty($data_list)}}
			{{$page_html|raw}}
		{{/if}}
		<!-- page end -->
	</div>
</div>
<!-- right content end  -->
		
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->